package book;

public class Book {

    private String name;//书名
    private String author;//作者
    private double price;//价格
    private boolean is_borrow;//借出的状态

    //初始化图书的状态，置为未借出
    {
        is_borrow = false;
    }
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public boolean isIs_borrow() {
        return is_borrow;
    }

    public void setIs_borrow(boolean is_borrow) {
        this.is_borrow = is_borrow;
    }

    public Book(String name, String author, double price) {
        this.name = name;
        this.author = author;
        this.price = price;
    }

    @Override
    public String toString() {
        return "Book{" +
                "name='" + name + '\'' +
                ", author='" + author + '\'' +
                ", price=" + price +
                (isIs_borrow() == false? "  未借阅" :"  已借阅") +
                '}';
    }
}
